package com.gqzm.side.common.interceptor;

import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName: {@link ParameterNameConverterFilter}
 * @description: 添加下划线转驼峰filter
 * @author: peter qin
 * @date: 2023 07 17
 * @version: 1.0
 **/
public class ParameterNameConverterFilter extends OncePerRequestFilter {

    @Override
    protected void doFilterInternal(HttpServletRequest request,
                                    HttpServletResponse response,
                                    FilterChain filterChain)
            throws ServletException, IOException {
        ParameterNameRequestWrapper requestWrapper = new ParameterNameRequestWrapper(request);
        filterChain.doFilter(requestWrapper, response);
    }
}
